//  https://www.luogu.com.cn/problem/P1164

#include<iostream>
using namespace std;

const int N = 110;
int a[N], m, n;
int dp[N][N];

int main()
{
    cin >> n >> m;
    for (int i = 1;i <= n;i++) cin >> a[i];

    dp[0][0] = 1;
    for (int i = 1;i <= n;i++)
    {
        for (int j = m;j >= 0;j--)
        {
            dp[i][j] = dp[i - 1][j];
            if (j >= a[i]) dp[i][j] += dp[i - 1][j - a[i]];
        }
    }
    cout << dp[n][m] << endl;
    return 0;
}